package ch06.test2;

import ch06.test2.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DemoTest {
    @Test
    public void test(){
        //实例化Spring的上下文
        ApplicationContext cxt=new ClassPathXmlApplicationContext("applicationch06test.xml");

        //获取UserService实例
        UserService userService= (UserService) cxt.getBean("userService");

        userService.show();
    }
}
